<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>具名插槽</title>
</head>
<body>
<div id="app">
    <computer>
        <!-- 替换插槽name=GPU中的内容 -->
        <div slot="GPU">GTX980Ti</div>
    </computer>
</div>
<template id="computerTem">
    <div>
        <slot name="CPU">这里插CPU</slot>
        <slot name="GPU">这里插GPU</slot>
    </div>
</template>
</body>
</html>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script>
    new Vue({
        el: "#app",
        components: {
            "computer": {
                template: "#computerTem"
            }
        }
    })

</script>